package com.snpic.appaw.module.insure.dal.mysql.carmessage;

import java.util.*;

import com.snpic.appaw.framework.common.pojo.PageResult;
import com.snpic.appaw.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.snpic.appaw.framework.mybatis.core.mapper.BaseMapperX;
import com.snpic.appaw.module.insure.dal.dataobject.carmessage.CarMessageDO;
import org.apache.ibatis.annotations.Mapper;
import com.snpic.appaw.module.insure.controller.app.carmessage.vo.*;

/**
 * 车险出单-车辆信息 Mapper
 *
 * @author lqs
 */
@Mapper
public interface CarMessageMapper extends BaseMapperX<CarMessageDO> {

	default PageResult<CarMessageDO> selectPage(AppCarMessagePageReqVO reqVO) {
		return selectPage(reqVO, new LambdaQueryWrapperX<CarMessageDO>()
			.eqIfPresent(CarMessageDO::getSessionid, reqVO.getSessionid())
			.eqIfPresent(CarMessageDO::getCitycode, reqVO.getCitycode())
			.eqIfPresent(CarMessageDO::getVehicleid, reqVO.getVehicleid())
			.eqIfPresent(CarMessageDO::getVehicleBrand, reqVO.getVehicleBrand())
			.eqIfPresent(CarMessageDO::getRackNo, reqVO.getRackNo())
			.eqIfPresent(CarMessageDO::getEngineNo, reqVO.getEngineNo())
			.eqIfPresent(CarMessageDO::getVehicleValue, reqVO.getVehicleValue())
			.betweenIfPresent(CarMessageDO::getRegisterDate, reqVO.getRegisterDate())
			.eqIfPresent(CarMessageDO::getTransferFlag, reqVO.getTransferFlag())
			.betweenIfPresent(CarMessageDO::getTransferDate, reqVO.getTransferDate())
			.eqIfPresent(CarMessageDO::getSeats, reqVO.getSeats())
			.eqIfPresent(CarMessageDO::getEnginecapacity, reqVO.getEnginecapacity())
			.eqIfPresent(CarMessageDO::getLicensetype, reqVO.getLicensetype())
			.eqIfPresent(CarMessageDO::getCurrentvalue, reqVO.getCurrentvalue())
			.eqIfPresent(CarMessageDO::getProducingArea, reqVO.getProducingArea())
			.eqIfPresent(CarMessageDO::getVehiclehyCode, reqVO.getVehiclehyCode())
			.eqIfPresent(CarMessageDO::getRunMileRate, reqVO.getRunMileRate())
			.likeIfPresent(CarMessageDO::getCarName, reqVO.getCarName())
			.eqIfPresent(CarMessageDO::getJingyouVehicleCode, reqVO.getJingyouVehicleCode())
			.likeIfPresent(CarMessageDO::getJingyouVehicleName, reqVO.getJingyouVehicleName())
			.eqIfPresent(CarMessageDO::getJingyouPrice, reqVO.getJingyouPrice())
			.likeIfPresent(CarMessageDO::getJingyouFamilyname, reqVO.getJingyouFamilyname())
			.eqIfPresent(CarMessageDO::getNoticeType, reqVO.getNoticeType())
			.eqIfPresent(CarMessageDO::getEcDemicVehicleFlag, reqVO.getEcDemicVehicleFlag())
			.eqIfPresent(CarMessageDO::getWholeWeight, reqVO.getWholeWeight())
			.likeIfPresent(CarMessageDO::getFuelTypeName, reqVO.getFuelTypeName())
			.likeIfPresent(CarMessageDO::getCertificateTypeName, reqVO.getCertificateTypeName())
			.eqIfPresent(CarMessageDO::getCertificateNo, reqVO.getCertificateNo())
			.betweenIfPresent(CarMessageDO::getCertificateDate, reqVO.getCertificateDate())
			.betweenIfPresent(CarMessageDO::getCreateTime, reqVO.getCreateTime())
			.eqIfPresent(CarMessageDO::getRemark, reqVO.getRemark())
			.eqIfPresent(CarMessageDO::getLicenseNo, reqVO.getLicenseNo())
			.eqIfPresent(CarMessageDO::getPriceType, reqVO.getPriceType())
			.eqIfPresent(CarMessageDO::getCertificateType, reqVO.getCertificateType())
			.eqIfPresent(CarMessageDO::getFuelType, reqVO.getFuelType())
			.eqIfPresent(CarMessageDO::getOldId, reqVO.getOldId())
			.eqIfPresent(CarMessageDO::getSelectStatus, reqVO.getSelectStatus())
			.eqIfPresent(CarMessageDO::getCustomerId, reqVO.getCustomerId())
			.eqIfPresent(CarMessageDO::getInsuredArea,reqVO.getInsuredArea())
			.orderByDesc(CarMessageDO::getId));
	}

	default List<CarMessageDO> selectList(AppCarMessagePageReqVO reqVO) {
		return selectList(new LambdaQueryWrapperX<CarMessageDO>()
			.eqIfPresent(CarMessageDO::getId,reqVO.getId())
			.eqIfPresent(CarMessageDO::getSessionid, reqVO.getSessionid())
			.eqIfPresent(CarMessageDO::getCitycode, reqVO.getCitycode())
			.eqIfPresent(CarMessageDO::getVehicleid, reqVO.getVehicleid())
			.eqIfPresent(CarMessageDO::getVehicleBrand, reqVO.getVehicleBrand())
			.eqIfPresent(CarMessageDO::getRackNo, reqVO.getRackNo())
			.eqIfPresent(CarMessageDO::getEngineNo, reqVO.getEngineNo())
			.eqIfPresent(CarMessageDO::getVehicleValue, reqVO.getVehicleValue())
			.betweenIfPresent(CarMessageDO::getRegisterDate, reqVO.getRegisterDate())
			.eqIfPresent(CarMessageDO::getTransferFlag, reqVO.getTransferFlag())
			.betweenIfPresent(CarMessageDO::getTransferDate, reqVO.getTransferDate())
			.eqIfPresent(CarMessageDO::getSeats, reqVO.getSeats())
			.eqIfPresent(CarMessageDO::getEnginecapacity, reqVO.getEnginecapacity())
			.eqIfPresent(CarMessageDO::getLicensetype, reqVO.getLicensetype())
			.eqIfPresent(CarMessageDO::getCurrentvalue, reqVO.getCurrentvalue())
			.eqIfPresent(CarMessageDO::getProducingArea, reqVO.getProducingArea())
			.eqIfPresent(CarMessageDO::getVehiclehyCode, reqVO.getVehiclehyCode())
			.eqIfPresent(CarMessageDO::getRunMileRate, reqVO.getRunMileRate())
			.likeIfPresent(CarMessageDO::getCarName, reqVO.getCarName())
			.eqIfPresent(CarMessageDO::getJingyouVehicleCode, reqVO.getJingyouVehicleCode())
			.likeIfPresent(CarMessageDO::getJingyouVehicleName, reqVO.getJingyouVehicleName())
			.eqIfPresent(CarMessageDO::getJingyouPrice, reqVO.getJingyouPrice())
			.likeIfPresent(CarMessageDO::getJingyouFamilyname, reqVO.getJingyouFamilyname())
			.eqIfPresent(CarMessageDO::getNoticeType, reqVO.getNoticeType())
			.eqIfPresent(CarMessageDO::getEcDemicVehicleFlag, reqVO.getEcDemicVehicleFlag())
			.eqIfPresent(CarMessageDO::getWholeWeight, reqVO.getWholeWeight())
			.likeIfPresent(CarMessageDO::getFuelTypeName, reqVO.getFuelTypeName())
			.likeIfPresent(CarMessageDO::getCertificateTypeName, reqVO.getCertificateTypeName())
			.eqIfPresent(CarMessageDO::getCertificateNo, reqVO.getCertificateNo())
			.betweenIfPresent(CarMessageDO::getCertificateDate, reqVO.getCertificateDate())
			.betweenIfPresent(CarMessageDO::getCreateTime, reqVO.getCreateTime())
			.eqIfPresent(CarMessageDO::getRemark, reqVO.getRemark())
			.eqIfPresent(CarMessageDO::getLicenseNo, reqVO.getLicenseNo())
			.eqIfPresent(CarMessageDO::getPriceType, reqVO.getPriceType())
			.eqIfPresent(CarMessageDO::getCertificateType, reqVO.getCertificateType())
			.eqIfPresent(CarMessageDO::getFuelType, reqVO.getFuelType())
			.eqIfPresent(CarMessageDO::getOldId, reqVO.getOldId())
			.eqIfPresent(CarMessageDO::getSelectStatus, reqVO.getSelectStatus())
			.eqIfPresent(CarMessageDO::getCustomerId, reqVO.getCustomerId())
			.eqIfPresent(CarMessageDO::getInsuredArea,reqVO.getInsuredArea())
			.orderByDesc(CarMessageDO::getId));
	}

}